﻿@model IEnumerable<LynxWebLog.Areas.Pages.ViewModels.PageEntry>

@{
    ViewBag.Title = "Index";
}

<h2>Index</h2>

<p>
    @Html.ActionLink("Create New", "Create")
</p>
<div class="table-responsive">
<table class="table">
    <tr>
        <th>
            @Html.DisplayNameFor(model => model.pd.blogid)
        </th>
        <th>
            @Html.DisplayNameFor(model => model.pd.title)
        </th>
        <th>
            @Html.DisplayNameFor(model => model.pd.IsPublished)
        </th>
        <th>
            @Html.DisplayNameFor(model => model.pd.DateCreated)
        </th>
        <th>
            @Html.DisplayName("Url")
        </th>
        <th></th>
    </tr>

@foreach (var item in Model) {
    <tr>
        <td>
            @Html.DisplayFor(modelItem => item.pd.blogid)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.pd.title)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.pd.IsPublished)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.pd.DateCreated)
        </td>
        <td>
            <a href="@item.Url(Context.Request.RequestContext)">@item.Url(Context.Request.RequestContext)</a>
        </td>
        <td>
            @Html.ActionLink("Edit", "Edit", new { id = item.pd.pageid }) |
            @Html.ActionLink("Details", "Details", new { id = item.pd.pageid }) |
            @Html.ActionLink("Delete", "Delete", new { id = item.pd.pageid })
        </td>
    </tr>
}

</table>
</div>
